//
//  UITableView+YTExtension.m
//  YiTuDriverClient
//
//  Created by 石少庸 on 2017/5/31.
//  Copyright © 2017年 Yitu. All rights reserved.
//

#import "UITableView+YTExtension.h"

@implementation UITableView (YTExtension)

#pragma mark - MJRefresh

/** 下拉*/
- (void)addRefreshControl:(void (^)())refreshCallBack {
    MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingBlock:refreshCallBack];
    header.lastUpdatedTimeLabel.hidden = YES;
    header.stateLabel.hidden = YES;
    [header.arrowView setHidden:YES];
    self.mj_header = header;
}
/** 上拉*/
- (void)addLoadDataControl:(void (^)())laodDataCallBack {
    MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:laodDataCallBack];
    footer.triggerAutomaticallyRefreshPercent = 0.1;
    footer.automaticallyHidden = YES;
    [footer setTitle:@"*^_^* 没了呀..." forState:MJRefreshStateNoMoreData];
    [footer setTitle:@"正在加载中..." forState:MJRefreshStateRefreshing];
    self.mj_footer = footer;
}

@end
